package
{
	import cohesion.io.ResourceCache;
	import cohesion.net.LoaderLite;
	import cohesion.pools.ObjectPool;
	import cohesion.system.trigger.Trigger;
	
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.ProgressEvent;
	
	import mx.utils.StringUtil;
	
	public class cohesion extends Sprite
	{
		public function cohesion()
		{
			var l:LoaderLite = new LoaderLite(2, false);
			l.addEventListener(ProgressEvent.PROGRESS, l_progressHandler);
			l.addEventListener(Event.COMPLETE, l_completeHandler);
			l.addItem("http://haizei.qiao.com/e.mp3");
			l.addItem("http://haizei.qiao.com/f.mp3");
			l.addItem("http://haizei.qiao.com/g.mp3");
			
			new ResourceCache();
		}
		
		protected function l_progressHandler(event:ProgressEvent):void
		{
			var l:LoaderLite = event.currentTarget as LoaderLite;
			trace(StringUtil.substitute("即时速度={0}, 平均速度={1}，正在加载的数据：已加载{2}、总字节{3}，加载进度{4}", l.speed, l.averageSpeed, l.bytesLoadedCurrent, l.bytesTotalCurrent, l.totalPercent));
		}
		
		protected function l_completeHandler(event:Event):void
		{
			trace("加载完成");
		}
	}
}